import axios from "axios";

//创建默认实例
const instance = new axios.create({
  baseURL: 'http://localhost:8083/',
  timeout: 5000,
});

//请求拦截器
instance.interceptors.request.use(config => {
  console.log("请求拦截器");
  return config;
})
//响应拦截器
instance.interceptors.response.use(resp => {
  console.log("响应拦截器");
  return resp;
}, error => {
  console.log("后台服务器出错了");
});

//暴露instance实例
export default instance;
